# -*- coding: utf-8 -*-

from odoo import models, fields, api
from odoo.exceptions import UserError
from odoo.tools import float_is_zero, float_compare


class HrDepartment(models.Model):
    _inherit = 'hr.department'

    auth_id = fields.Many2one('hr.department.auth.settings', string=u'相关权限')

class HrAuthSettings(models.Model):
    _name = 'hr.department.auth.settings'
    name = fields.Char(string='名称')

    approve_line_ids = fields.One2many('department.approve.model.info', 'auth_id')


class DepartmentApproveModelInfo(models.Model):
    """
    相关签核单据
    """

    _name = 'department.approve.model.info'
    auth_id = fields.Many2one('hr.department.auth.settings')

    model = fields.Selection([

    ])
    amount = fields.Float(string=u'金額')


class HrAuthSettingsLine(models.Model):
    _name = 'hr.department.auth.settings.line'
    _order = 'sequence'
    setting_id = fields.Many2one('hr.department.auth.settings')
    sequence = fields.Integer(default=10)
    user_id = fields.Many2one('res.users', string=u'人員')
    remark = fields.Char(string=u'备注')
